var http = require('http'),
 
    socketIO = require('socket.io'),
 
    port = 8282,
 
    ip = '192.168.1.204',//"192.168.158.1",//"127.0.0.1",//'192.168.1.204',
 
    server = http.createServer().listen(port, ip, function(){
        console.log('Socket.IO server started at %s:%s!', ip, port);
    }),
 
    io = socketIO.listen(server);
 
io.set('match origin protocol', true);
io.set('origins', '*:*');
io.set('log level', 1);

var run = function(socket){
    socket.on('user-join', function(data){
        console.log('User %s have joined', data);
        socket.broadcast.emit('new-user', data);
 
    })
}
 
io.sockets.on('connection', run);